#include <REG52.H>

sbit led = P3 ^ 7;

void delay(unsigned int t)
{
    while (t--);
}

void main()
{
    unsigned int time, i;
    while (1)
    {
 
        for (time = 0; time < 100; time++){
           for (i = 0; i < 20; i++){
                led = 0;
                delay(time);
                led = 1;
                delay(100 - time);
            }        }

        for (time = 100; time > 0; time--){
            for (i = 0; i < 20; i++){
                led = 0;
                delay(time);
                led = 1;
                delay(100 - time);
            }
        }
    }

}